package correct.day25;

import java.util.ArrayList;
import java.util.Arrays;

public class Test2 {
    public boolean hostschedule (ArrayList<ArrayList<Integer>> sc)
    {
        int m = sc.size(), n = sc.get(0).size();
        int[][] schedule = new int[m][n];
        for(int i = 0; i < m; i++)
        {
            for(int j = 0; j < n; j++)
            {
                schedule[i][j] = sc.get(i).get(j);
            }
        }

        // Arrays.sort()默认是将数组调整为升序
        Arrays.sort(schedule, (v1, v2) -> {
            return v1[0] - v2[0];
        });

        for(int i = 1; i < schedule.length; i++)
        {
            if(schedule[i][0] < schedule[i - 1][1]) return false;
        }

        return true;
    }


    public static void main(String[] args) {
        int[][] schedule = {{0, 10}, {20, 30}, {10, 20}};
//        System.out.println(hostschedule(schedule));
    }
}
